﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test2.aspx.cs" Inherits="TripLOA.GUI.service.georef_test_2.Test2" %>

<%@ Register Assembly="MapControl2" Namespace="MapControl2" TagPrefix="map2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="myScriptManager" runat="server">
            <Services>
                <asp:ServiceReference Path="~/service/georef_test_2/WSGeoRef.asmx" InlineScript="false" />
            </Services>
        </asp:ScriptManager>
        
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Button ID="Button4" runat="server" Text="createTripByGeolocs" OnClientClick="testAddTrip()" />
                <map2:LOAMap ID="map2_id" runat="server" MapDiv="map_id" ZoomLevel="10" Editable="true" TargetControlIDs="Button1"/>
            </ContentTemplate>
        </asp:UpdatePanel>
        
        <div id="map_id" style="position: absolute; top: 30px; left: 0px; width: 100%; height: 450px"></div>
    </form>
    
    <script type="text/javascript">
        function testAddTrip(){
            
            var gloc1 = new Object();
            gloc1.Address = 'Livorno';
            gloc1.Description = 'abbasso pisa';
            gloc1.gettingInUsers = [];
            gloc1.gettingOffUsers = [];
            gloc1.lat = 43.55296;
            gloc1.lng = 10.31994;
            
            var gloc2 = new Object();
            gloc2.Address = 'Pisa';
            gloc2.lat = 43.70995;
            gloc2.lng = 10.39888;
            gloc2.Description = 'abbasso livorno';
            gloc2.gettingInUsers = [];
            gloc2.gettingOffUsers = [];
            
            var glocs = new Array(gloc1, gloc2);
            
            var vehicle = new Object();
            vehicle.Id = 0;
            vehicle.Class = 0;
            var map = Sys.Application.findComponent("map2_id");
            map.setEditableTripA2BFromGeolocs(glocs, vehicle);
        };
    </script>

</body>
</html>
